package com.zhongwang.mms.module.material.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Calendar;
import java.util.Date;

/**
 * @Description: 项目划库存表
 * @Author: wsg
 * @Date: 2020/05/16
 */
@Data
public class MProjectInventoryMarkModel {

    @ExcelIgnore
    private Integer pimId;  // 主键

    @ExcelIgnore
    private Integer pimAfterItyId;  // 划后原料库存外键

    @ExcelIgnore
    private Integer pimBeforeItyId; // 划前原料库存外键

    @ExcelProperty(value = "标记数量",index = 10)
    private Double pimNum;  // 标记数量

    @ExcelProperty(value = "标记重量",index = 11)
    private Double pimWeight;   // 标记重量

    @ExcelProperty(value = "标记时间",index = 14)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date pimDate;   // 标记时间

    @ExcelProperty(value = "标记人员",index = 13)
    private String pimProposer; // 标记人员

    @ExcelIgnore
    private String pimRemark;   // 备注

    @ExcelIgnore
    private Integer pimAppStatus;   // 0删除 1未提交 2已提交 3执行 4驳回

    @ExcelProperty(value = "状态",index = 12)
    private String pimAppStatusName;   // 0删除 1未提交 2已提交 3执行 4驳回

    @ExcelIgnore
    private String pimAccount;  // 帐号

    @ExcelIgnore
    private Date pimChekcDate;  // 执行时间

    @ExcelIgnore
    private String pimExecutor; // 执行人员

    @ExcelIgnore
    private Double pimPrice;    // 单价

    @ExcelProperty(value = "项目编号",index = 7)
    private String ityProCode;  // 项目编码

    @ExcelProperty(value = "项目名称",index = 8)
    private String ityProName;  // 项目名称

    @ExcelProperty(value = "跟踪号",index = 6)
    private String ityTrackCode;    // 跟踪号

    @ExcelProperty(value = "特殊说明",index = 9)
    private String itySpec; // 特殊说明

    @ExcelIgnore
    private Double ityAvaNum;   // 原料可用数量

    @ExcelIgnore
    private Double ityAvaWeight;    // 原料可用重量

    @ExcelProperty(value = "类型",index = 0)
    private String matTypeName; // 类型

    @ExcelProperty(value = "材质",index = 1)
    private String matQualityName;  // 材质

    @ExcelProperty(value = "规格",index = 2)
    private String matSpecName; // 规格

    @ExcelProperty(value = "宽度",index = 3)
    private Double matWidth;    // 宽度

    @ExcelProperty(value = "长度",index = 4)
    private Double matLength;   // 长度

    @ExcelProperty(value = "米重/厚度",index = 5)
    private Double matHeight;   // 高度

    @ExcelIgnore
    //@ExcelProperty(value = "物料描述",index = 0)
    private String matNameDesc; // 原料描述

    @ExcelIgnore
    private Integer matFormulaType; // 重量计算公式类型

    /**
     * 检索页面区分 1=项目划库存标记记录 2=项目划库存执行
     */
    @ExcelIgnore
    private Integer sourceFlgQuery;

    /**
     * 检索开始日期
     */
    @ExcelIgnore
    private Date startTimeQuery;

    /**
     * 检索结束日期
     */
    @ExcelIgnore
    private Date endTimeQuery;

    public void setEndTimeQuery(Date endTimeQuery) {
        if (endTimeQuery != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endTimeQuery);
            cal.add(Calendar.DAY_OF_YEAR, +1);
            this.endTimeQuery = cal.getTime();
        } else {
            this.endTimeQuery = endTimeQuery;
        }
    }

    @ExcelProperty(value = "库位",index = 15)
    private String whiName;

}